home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / misc / tri14dev.lha / Triton / Developer / DemoSource / toolmanager2.c < prev    next >
C/C++ Source or Header  |  1995-08-25  |  4KB  |  143 lines

  1. /*
  2.  *  Triton - The object oriented GUI creation system for the Amiga
  3.  *  Written by Stefan Zeiger in 1993-1995
  4.  *
  5.  *  (c) 1993-1995 by Stefan Zeiger
  6.  *  You are hereby allowed to use this source or parts
  7.  *  of it for creating programs for AmigaOS which use the
  8.  *  Triton GUI creation system. All other rights reserved.
  9.  *
  10.  *  Toolmanager2.c - Looks like the ToolManager demo 2 of GUIFront
  11.  *
  12.  */
  13.  
  14.  
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. #include <string.h>
  18.  
  19. #include <libraries/triton.h>
  20.  
  21. #ifdef __GNUC__
  22. #ifndef __OPTIMIZE__
  23. #include <clib/triton_protos.h>
  24. #else
  25. #include <inline/triton.h>
  26. #endif /* __OPTIMIZE__ */
  27. #else
  28. #include <proto/triton.h>
  29. #endif /* __GNUC__ */
  30.  
  31.  
  32. STRPTR cycle_entries[]={"Exec","Image","Sound","Menu","Icon","Dock","Access",NULL};
  33.  
  34. extern struct List LVList;
  35.  
  36. struct Node LVNodes[] =
  37. {
  38.   { &LVNodes[1], (struct Node *)&LVList.lh_Head,  0, 0, "2024view" },
  39.   { &LVNodes[2], &LVNodes[0],                     0, 0, "Add to archive" },
  40.   { &LVNodes[3], &LVNodes[1],                     0, 0, "Delete" },
  41.   { &LVNodes[4], &LVNodes[2],                     0, 0, "Edit text" },
  42.   { &LVNodes[5], &LVNodes[3],                     0, 0, "Env" },
  43.   { &LVNodes[6], &LVNodes[4],                     0, 0, "Exchange" },
  44.   { &LVNodes[7], &LVNodes[5],                     0, 0, "Global Help System" },
  45.   { &LVNodes[8], &LVNodes[6],                     0, 0, "Multiview" },
  46.   { (struct Node *)&LVList.lh_Tail, &LVNodes[7],  0, 0, "Paint" }
  47. };
  48.  
  49. struct List LVList={&LVNodes[0],NULL,&LVNodes[8],0,0};
  50.  
  51.  
  52. int main(void)
  53. {
  54.   if(TR_OpenTriton(TRITON11VERSION,TRCA_Name,"ToolManagerGUIDemo2",TRCA_LongName,"ToolManager GUI demo 2",TRCA_Info,"Looks like the ToolManager demo 2 of GUIFront",TAG_END))
  55.   {
  56.     TR_AutoRequestTags(Application,NULL,
  57.       WindowID(0), WindowPosition(TRWP_MOUSEPOINTER),
  58.       WindowTitle("ToolManager GUI demo 2"), WindowFlags(TRWF_NOSIZEGADGET|TRWF_NODELZIP|TRWF_ZIPTOCURRENTPOS),
  59.       WindowBackfillNone,
  60.  
  61.       VertGroupA,
  62.  
  63.         Space,
  64.  
  65.         HorizGroupAC,
  66.           Space,
  67.           TextID("_Object Type",1),
  68.           Space,
  69.           CycleGadget(cycle_entries,0,1),
  70.           Space,
  71.         EndGroup,
  72.  
  73.         Space,
  74.  
  75.         HorizGroup,
  76.           Space,
  77.           NamedFrameBox("Object List"),
  78.             HorizGroupAC,
  79.               Space,
  80.               VertGroupA,
  81.                 Space,
  82.                 ListSSCN(&LVList,2,0,0),
  83.                 Space,
  84.               EndGroup,
  85.               Space,
  86.               VertGroupA|TRGR_FIXHORIZ,
  87.                 Space,
  88.                 Button("Top",3),
  89.                 Space,
  90.                 Button("Up",4),
  91.                 Space,
  92.                 Button("Down",5),
  93.                 Space,
  94.                 Button("Bottom",6),
  95.                 Space,
  96.                 Button("So_rt",7),
  97.                 Space,
  98.               EndGroup,
  99.               Space,
  100.             EndGroup,
  101.           Space,
  102.         EndGroup,
  103.  
  104.         Space,
  105.  
  106.         HorizGroupEA,
  107.           Space,
  108.           Button("_New...",8),
  109.           Space,
  110.           Button("_Edit...",9),
  111.           Space,
  112.           Button("Co_py",10),
  113.           Space,
  114.           Button("Remove",11),
  115.           Space,
  116.         EndGroup,
  117.  
  118.         Space,
  119.  
  120.         HorizGroupEA,
  121.           Space,
  122.           Button("_Save",12),
  123.           Space,
  124.           Button("_Use",13),
  125.           Space,
  126.           Button("_Test",14),
  127.           Space,
  128.           Button("_Cancel",15),
  129.           Space,
  130.         EndGroup,
  131.  
  132.         Space,
  133.  
  134.       EndGroup,
  135.  
  136.       TAG_END);
  137.     TR_CloseTriton();
  138.     return 0;
  139.   }
  140.   puts("Can't open triton.library v2+.");
  141.   return 20;
  142. }
  143.